/*
	jGrouse framework
	Copyright 2007 by Denis Riabtchik 
	All rights reserved.
	
	Licensed under modified BSD license. See license.txt for details
*/


/**
	@module jgrouse.widgets.InputControl
	@requires jgrouse.widgets.Widget
*/

jgrouse.module(
{
	name : 'jgrouse.widgets.InputControl',
	requires : ['jgrouse.widgets.Widget'],
	imports : ['jgrouse.widgets.Widget'],
	body : function(embed)
	{
		eval(embed);
		
		
		/**
			Widget implementing form control (equivalent to HTML's &lt;input&gt;).
			@class jgrouse.widgets.InputControl
			@extends jgrouse.widgets.Widget
		*/
		jgrouse.define('jgrouse.widgets.InputControl', 'jgrouse.widgets.Widget', function(salt)
		{
			eval(salt);
			
			return {
				/**
					@constructor initialize
					@inheritdesc
				*/
				initialize : function(options, styles)
				{
					_super(this, 'initialize', options, styles);
					this._tagName = 'input';
				},
				
				/**
					Set the <b>name</b> property
					@function setName
					@param {String} value - name to set
				*/
				setName : function(value)
				{
					this.setAttribute('name', value);
				},
				
				/**
					Get the <b>name</b> property.
					@function {String} getName
					@returns name of control
				*/
				getName : function()
				{
					return this.getAttribute('name');
				},
				
				/**
					Set the <b>value</b> property
					@function setValue
					@param {String} value - value to set
				*/
				setValue : function(value)
				{
					this.setAttribute('value', value);
				},
				
				/**
					Retrieve the <b>value</b> property
					@function {String} getValue
				*/
				getValue : function()
				{
					return this._attributes.value;
				}
			}
		});
	}
});